package com.example.day2201;

/**
 * @author Lenovo
 */
public class Addable {
    public
    interface addable {
        int add(int x, int y);
    }

    public interface Flyable {
        void fly(String s);
    }

    public class LambdaDemo {
        public static void main(String[] args) {
            useAddable((x, y) -> {
                return x + y;
            });
            useFlyable(s -> System.out.println(s));
            useAddable((x, y) -> x + y);
        }

        private static void useFlyable(Flyable f) {
            f.fly("风和日丽，晴空万里");
        }

        private static void useAddable(addable a) {
            int sum = a.add(10, 20);
            System.out.println(sum);
        }
    }
}
